﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using MISAPP.Classify.Service;
using MISAPP.MISInterface;


public partial class View_CIB_CIB006 : ViewMatrix //System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

        Title = "CIB聯貸案";
        limit();
        serviceName = "MISAPP.Classify.Service.Service_CIB006";
        if (!IsPostBack)
        {
            FillCriteria("GetCriteriaData", "SetData");
            FillGroupBy("GetGroupBy", CLG_GroupBy);
        }
    }

    protected void btn_Execute_Click(object sender, EventArgs e)
    {
        string GRPList = CLG_GroupBy.GetSelect();
        if (!Check(GRPList))
        {
            lbl_result.Text = "請選擇小計項目";
            return;
        }
        execute();
        Server.Transfer("CIB006_1.aspx");
    }

    protected void execute()
    {
        
        List<iSelectList> CriteriaList = GetSelectCLB();

        Session["Criteria"] = CriteriaList;
        Session["GroupBy"] = CLG_GroupBy.GetSelect();
    }


    protected bool Check(string p_select)
    {
        bool ok = true;
        if (p_select.Length == 0)
        {
            //TODO 檢查不過時，要顯示訊息
            ok = false;
        }
        return ok;
    }
}
